package routers

import (
	"gitee.com/williamguang/verify/lib"
	"gitee.com/williamguang/verify/modules"
	"github.com/gin-contrib/cors"

	"github.com/gin-gonic/gin"
)

func Route() *gin.Engine {
	mode := lib.Config.Get("ginMode")
	gin.SetMode(mode.(string))
	router := gin.Default()
	config := cors.DefaultConfig()
	config.AllowAllOrigins = true
	router.Use(cors.New(config))

	sidecar := router.Group("/verify")
	sidecar.GET("/hi", modules.Hi)
	sidecar.POST("/ftp/changePwd", modules.ChangePwd4Ftp)


	return router
}
